﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BusinessLibrary
{
    public static class BLLTools
    {
        public static object DBValues(object Value)
        {

            if ((Value is decimal || Value is Decimal) && Value != null)
                if ((decimal)Value == -1)
                    return DBNull.Value;
                else
                    return Value;
            else if ((Value is string || Value is String) && Value != null)
                return Value;
            else if (Value is int && Value != null)
                return Value;
            else if (Value is DateTime && Value != null)
                return Value;
            else if ((Value is bool || Value is Boolean) && Value != null)
                return Value;
            else if (Value is long && Value != null)
                return Value;
            else if (Value is float && Value != null)
                return Value;
            else if ((Value is byte || Value is Byte) && Value != null)
                return Value;

                //...... la suite des declaration....TODO

            else
                return DBNull.Value;

        }

    }
}
